package com.scut.fy.flow.service.impl;

import com.scut.fy.flow.service.FlowService;
import org.flowable.bpmn.converter.BpmnXMLConverter;
import org.flowable.engine.repository.Deployment;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.xml.stream.XMLInputFactory;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;

//@Service
public class FlowServiceImpl implements FlowService {

    private static final Logger log = LoggerFactory.getLogger(FlowServiceImpl.class);

    private String resourcePath = Thread.currentThread().getContextClassLoader().getResource("").getPath();

    private String flowPath = resourcePath+"";
    @Override
    public Deployment createFlow() {
        try {
            BpmnXMLConverter bpmnXMLConverter = new BpmnXMLConverter();
            XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance();
            InputStream inputStream = new FileInputStream(new File(flowPath));
        } catch (Exception e) {
            return null;
        }
        return null;
    }
}
